﻿///***************************************************************
/// 시  스  템 : Updms.Ref.Dac
/// 단위시스템 : REF
/// 계      층 : Data Access Layer
/// 프로그램명 : Ref_Dac_UPDMS_REF_TOUR
/// 파  일  명 : Ref_Dac_UPDMS_REF_TOUR.cs
/// 설      명 : 기행기관리
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2013-04-17 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;

namespace Updms.Ref.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Ref_Dac_UPDMS_REF_TOUR : Base.AppFramework.DacBase
	{
		public Ref_Dac_UPDMS_REF_TOUR()
		{
		}

		#region NT [GetSearchCount]
		/// <summary>
		/// 기행기 검색결과 건수조회
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_REF_TOUR_Get_Search_Count";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return (int)_agent.ExecuteScalar(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [SelectProcess]
		/// <summary>
		/// 기행기 조회
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_REF_TOUR_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_REF_TOUR", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion


		#region RT [Insert]
		/// <summary>
		/// 기행기 저장
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_REF_TOUR_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Update]
		/// <summary>
		/// 기행기 수정
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_REF_TOUR_Update";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Delete]
		/// <summary>
		/// 기행기 삭제
		/// </summary>
		/// <param name="ls_xml"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string ls_sql = "usp_UPDMS_REF_TOUR_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

	}
}
